﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;

namespace blackhouse.Web {
    public static class LiteralExtend {

        public static void FormatOnTextFormat(this Literal control, object fieldValue, string fallbackFormat) {
            string f = control.Text;
            if (!f.Contains("{0}"))
                f = fallbackFormat;
            control.Text = String.Format(f, fieldValue);
        }

    }
}